Reads the name of a subkey according to it's instance.
RegEnumKey ( "keyname", instance )
Parameters
keyname | The registry key to read. |
instance | The 1-based key instance to retrieve |
Return Value
Success: | Returns the requested subkey name.. |
Failure: | Returns an error message string and sets the @error flag: |
1 if unable to open requested key | |
2 if unable to open requested main key | |
3 if unable to remote connect to the registry | |
-1 if unable to retrieve requested subkey (key instance out of range) |
Remarks
A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC").
Related
RegEnumVal, RegDelete, RegWrite
Example
For $i= 1 to 10
$var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE", $i)
If @error <> 0 then ExitLoop
MsgBox(4096, "SubKey #" & $i & " under HKLM\Software: ", $var)
Next